package com.explorx.sns.puma.im.core.chat.consts;

import java.util.Arrays;
import java.util.Optional;

public enum StatusEnum {
    OK(0,""),
    DELETE(1,"delete"),
    UNKOWN(99,"unkown");

    StatusEnum(int value, String desc) {
        this.value = value;
        this.desc = desc;
    }


    public int getValue() {
        return value;
    }

    public String getDesc() {
        return desc;
    }

    private int value;
    private String desc;

    static StatusEnum findById(int value){
        final Optional<StatusEnum> any = Arrays.stream(StatusEnum.values()).filter(ele -> ele.value == value).findAny();

        return any.isPresent() ? any.get():UNKOWN;
    }

}
